package com.xl.controller;

import com.xl.config.WebsocketConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.DestinationVariable;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@MessageMapping("/nms")
public class WSReactiveController {

    @Autowired
    private WebsocketConfig websocketConfig;

    @MessageMapping("/heartbeat/{destination}")
    public void hearBeat(@DestinationVariable("destination") String destination, String msg) {
        System.out.println(websocketConfig.getClass().getName());
        System.out.println(msg);
    }

    @MessageMapping("/command/{destination}")
    public void runCommand(@DestinationVariable("destination") String destination, String msg) {
        System.out.println();
    }

}
